<?php
include(APPPATH.'/controllers/frontend.php');
class Home extends Frontend
{
    function Home()
    {
        parent::Frontend();
    }
    
    function index() 
    {
        $this->data["user"] = &$this->MUser->detail;
        $this->layout[MY_Controller::VIEW_FILE] = "home";
    }
    
    function login() 
    {
        $username = $this->input->post("username");
        $password = $this->input->post("password");
        $return_url = $this->input->post("return_url");
        
        $this->data["user"] = $this->MUser->login($username,$password);
        redirect($return_url);
    }
    
    function logout()
    {
        $this->MUser->logout();
        redirect(site_url("home"));
    }
}